package com.ruoyi.lm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lm.mapper.LmTimesrecordMapper;
import com.ruoyi.lm.domain.LmTimesrecord;
import com.ruoyi.lm.service.ILmTimesrecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 次数消费记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-02
 */
@Service
public class LmTimesrecordServiceImpl implements ILmTimesrecordService 
{
    @Autowired
    private LmTimesrecordMapper lmTimesrecordMapper;

    /**
     * 查询次数消费记录
     * 
     * @param id 次数消费记录ID
     * @return 次数消费记录
     */
    @Override
    public LmTimesrecord selectLmTimesrecordById(String id)
    {
        return lmTimesrecordMapper.selectLmTimesrecordById(id);
    }

    /**
     * 查询次数消费记录列表
     * 
     * @param lmTimesrecord 次数消费记录
     * @return 次数消费记录
     */
    @Override
    public List<LmTimesrecord> selectLmTimesrecordList(LmTimesrecord lmTimesrecord)
    {
        return lmTimesrecordMapper.selectLmTimesrecordList(lmTimesrecord);
    }

    /**
     * 新增次数消费记录
     * 
     * @param lmTimesrecord 次数消费记录
     * @return 结果
     */
    @Override
    public int insertLmTimesrecord(LmTimesrecord lmTimesrecord)
    {
        lmTimesrecord.setCreateTime(DateUtils.getNowDate());
        return lmTimesrecordMapper.insertLmTimesrecord(lmTimesrecord);
    }

    /**
     * 修改次数消费记录
     * 
     * @param lmTimesrecord 次数消费记录
     * @return 结果
     */
    @Override
    public int updateLmTimesrecord(LmTimesrecord lmTimesrecord)
    {
        return lmTimesrecordMapper.updateLmTimesrecord(lmTimesrecord);
    }

    /**
     * 删除次数消费记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLmTimesrecordByIds(String ids)
    {
        return lmTimesrecordMapper.deleteLmTimesrecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除次数消费记录信息
     * 
     * @param id 次数消费记录ID
     * @return 结果
     */
    @Override
    public int deleteLmTimesrecordById(String id)
    {
        return lmTimesrecordMapper.deleteLmTimesrecordById(id);
    }
}
